package qianting.news.behavior.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import qianting.news.apis.models.behavior.dtos.LikesBehaviorDto;
import qianting.news.behavior.service.ApLikesBehaviorService;
import qianting.news.common.entity.State;

@Api(tags = "文章点赞行为管理")
@RestController
@RequestMapping("/")
public class ApLikesBehaviorController {

    @Autowired
    private ApLikesBehaviorService apLikesBehaviorService;

    @ApiOperation(value = "点赞文章或取消点赞")
    @PostMapping("like")
    public State like(@RequestBody LikesBehaviorDto dto) {
        return apLikesBehaviorService.like(dto);
    }

}
